3.51 \(\int x^2 (a+b \log (c x^n))^2 \, dx\)

Optimal. Leaf size=52 \[ \frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right )^2-\frac {2}{9} b n x^3 \left (a+b \log \left (c x^n\right )\right )+\frac {2}{27} b^2 n^2 x^3 \]

[Out]

2/27*b^2*n^2*x^3-2/9*b*n*x^3*(a+b*ln(c*x^n))+1/3*x^3*(a+b*ln(c*x^n))^2

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2305, 2304} \[ \frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right )^2-\frac {2}{9} b n x^3 \left (a+b \log \left (c x^n\right )\right )+\frac {2}{27} b^2 n^2 x^3 \]

Antiderivative was successfully verified.

[In]

Int[x^2*(a + b*Log[c*x^n])^2,x]

[Out]

(2*b^2*n^2*x^3)/27 - (2*b*n*x^3*(a + b*Log[c*x^n]))/9 + (x^3*(a + b*Log[c*x^n])^2)/3

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rubi steps

\begin {align*} \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right )^2-\frac {1}{3} (2 b n) \int x^2 \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=\frac {2}{27} b^2 n^2 x^3-\frac {2}{9} b n x^3 \left (a+b \log \left (c x^n\right )\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right )^2\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 46, normalized size = 0.88 \[ \frac {1}{3} \left (x^3 \left (a+b \log \left (c x^n\right )\right )^2+\frac {2}{9} b n x^3 \left (-3 a-3 b \log \left (c x^n\right )+b n\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x^2*(a + b*Log[c*x^n])^2,x]

[Out]

((2*b*n*x^3*(-3*a + b*n - 3*b*Log[c*x^n]))/9 + x^3*(a + b*Log[c*x^n])^2)/3

________________________________________________________________________________________

fricas [B]  time = 0.42, size = 103, normalized size = 1.98 \[ \frac {1}{3} \, b^{2} n^{2} x^{3} \log \relax (x)^{2} + \frac {1}{3} \, b^{2} x^{3} \log \relax (c)^{2} - \frac {2}{9} \, {\left (b^{2} n - 3 \, a b\right )} x^{3} \log \relax (c) + \frac {1}{27} \, {\left (2 \, b^{2} n^{2} - 6 \, a b n + 9 \, a^{2}\right )} x^{3} + \frac {2}{9} \, {\left (3 \, b^{2} n x^{3} \log \relax (c) - {\left (b^{2} n^{2} - 3 \, a b n\right )} x^{3}\right )} \log \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))^2,x, algorithm="fricas")

[Out]

1/3*b^2*n^2*x^3*log(x)^2 + 1/3*b^2*x^3*log(c)^2 - 2/9*(b^2*n - 3*a*b)*x^3*log(c) + 1/27*(2*b^2*n^2 - 6*a*b*n +
 9*a^2)*x^3 + 2/9*(3*b^2*n*x^3*log(c) - (b^2*n^2 - 3*a*b*n)*x^3)*log(x)

________________________________________________________________________________________

giac [B]  time = 0.35, size = 111, normalized size = 2.13 \[ \frac {1}{3} \, b^{2} n^{2} x^{3} \log \relax (x)^{2} - \frac {2}{9} \, b^{2} n^{2} x^{3} \log \relax (x) + \frac {2}{3} \, b^{2} n x^{3} \log \relax (c) \log \relax (x) + \frac {2}{27} \, b^{2} n^{2} x^{3} - \frac {2}{9} \, b^{2} n x^{3} \log \relax (c) + \frac {1}{3} \, b^{2} x^{3} \log \relax (c)^{2} + \frac {2}{3} \, a b n x^{3} \log \relax (x) - \frac {2}{9} \, a b n x^{3} + \frac {2}{3} \, a b x^{3} \log \relax (c) + \frac {1}{3} \, a^{2} x^{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))^2,x, algorithm="giac")

[Out]

1/3*b^2*n^2*x^3*log(x)^2 - 2/9*b^2*n^2*x^3*log(x) + 2/3*b^2*n*x^3*log(c)*log(x) + 2/27*b^2*n^2*x^3 - 2/9*b^2*n
*x^3*log(c) + 1/3*b^2*x^3*log(c)^2 + 2/3*a*b*n*x^3*log(x) - 2/9*a*b*n*x^3 + 2/3*a*b*x^3*log(c) + 1/3*a^2*x^3

________________________________________________________________________________________

maple [C]  time = 0.21, size = 692, normalized size = 13.31 \[ \frac {b^{2} x^{3} \ln \left (x^{n}\right )^{2}}{3}+\frac {\left (-3 i \pi b \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )+3 i \pi b \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+3 i \pi b \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}-3 i \pi b \mathrm {csgn}\left (i c \,x^{n}\right )^{3}-2 b n +6 b \ln \relax (c )+6 a \right ) b \,x^{3} \ln \left (x^{n}\right )}{9}+\frac {\left (-9 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right )^{2} \mathrm {csgn}\left (i x^{n}\right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+18 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right )^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{3}+18 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{3}-36 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{4}+12 i \pi \,b^{2} n \mathrm {csgn}\left (i c \,x^{n}\right )^{3}-36 i \pi \,b^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{3} \ln \relax (c )-36 i \pi a b \mathrm {csgn}\left (i c \,x^{n}\right )^{3}+36 a^{2}-12 i \pi \,b^{2} n \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}-12 i \pi \,b^{2} n \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+36 i \pi \,b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \ln \relax (c )+36 i \pi \,b^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \ln \relax (c )+36 i \pi a b \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+36 i \pi a b \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+8 b^{2} n^{2}-9 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{4}+18 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{5}-9 \pi ^{2} b^{2} \mathrm {csgn}\left (i x^{n}\right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{4}+18 \pi ^{2} b^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{5}+72 a b \ln \relax (c )-24 b^{2} n \ln \relax (c )+36 b^{2} \ln \relax (c )^{2}-24 a b n -9 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{6}-36 i \pi \,b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) \ln \relax (c )-36 i \pi a b \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )+12 i \pi \,b^{2} n \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )\right ) x^{3}}{108} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a+b*ln(c*x^n))^2,x)

[Out]

1/3*x^3*b^2*ln(x^n)^2+1/9*b*x^3*(-3*I*Pi*b*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+3*I*Pi*b*csgn(I*c)*csgn(I*c*x^n
)^2+3*I*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)^2-3*I*Pi*b*csgn(I*c*x^n)^3-2*b*n+6*b*ln(c)+6*a)*ln(x^n)+1/108*x^3*(-36*
I*ln(c)*Pi*b^2*csgn(I*c*x^n)^3-9*Pi^2*b^2*csgn(I*c)^2*csgn(I*x^n)^2*csgn(I*c*x^n)^2-36*I*Pi*a*b*csgn(I*c*x^n)^
3-36*Pi^2*b^2*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)^4+18*Pi^2*b^2*csgn(I*c)^2*csgn(I*x^n)*csgn(I*c*x^n)^3+12*I*P
i*b^2*n*csgn(I*c*x^n)^3+18*Pi^2*b^2*csgn(I*c)*csgn(I*x^n)^2*csgn(I*c*x^n)^3+36*a^2+8*b^2*n^2+72*a*b*ln(c)-24*b
^2*n*ln(c)+36*b^2*ln(c)^2-9*Pi^2*b^2*csgn(I*x^n)^2*csgn(I*c*x^n)^4+18*Pi^2*b^2*csgn(I*x^n)*csgn(I*c*x^n)^5-24*
a*b*n-9*Pi^2*b^2*csgn(I*c*x^n)^6+18*Pi^2*b^2*csgn(I*c)*csgn(I*c*x^n)^5-9*Pi^2*b^2*csgn(I*c)^2*csgn(I*c*x^n)^4+
36*I*ln(c)*Pi*b^2*csgn(I*x^n)*csgn(I*c*x^n)^2+36*I*ln(c)*Pi*b^2*csgn(I*c*x^n)^2*csgn(I*c)+36*I*Pi*a*b*csgn(I*x
^n)*csgn(I*c*x^n)^2+36*I*Pi*a*b*csgn(I*c*x^n)^2*csgn(I*c)-12*I*Pi*b^2*n*csgn(I*x^n)*csgn(I*c*x^n)^2-12*I*Pi*b^
2*n*csgn(I*c*x^n)^2*csgn(I*c)-36*I*Pi*a*b*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)+12*I*Pi*b^2*n*csgn(I*x^n)*csgn(I
*c*x^n)*csgn(I*c)-36*I*ln(c)*Pi*b^2*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c))

________________________________________________________________________________________

maxima [A]  time = 0.67, size = 71, normalized size = 1.37 \[ \frac {1}{3} \, b^{2} x^{3} \log \left (c x^{n}\right )^{2} - \frac {2}{9} \, a b n x^{3} + \frac {2}{3} \, a b x^{3} \log \left (c x^{n}\right ) + \frac {1}{3} \, a^{2} x^{3} + \frac {2}{27} \, {\left (n^{2} x^{3} - 3 \, n x^{3} \log \left (c x^{n}\right )\right )} b^{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))^2,x, algorithm="maxima")

[Out]

1/3*b^2*x^3*log(c*x^n)^2 - 2/9*a*b*n*x^3 + 2/3*a*b*x^3*log(c*x^n) + 1/3*a^2*x^3 + 2/27*(n^2*x^3 - 3*n*x^3*log(
c*x^n))*b^2

________________________________________________________________________________________

mupad [B]  time = 3.56, size = 62, normalized size = 1.19 \[ x^3\,\left (\frac {a^2}{3}-\frac {2\,a\,b\,n}{9}+\frac {2\,b^2\,n^2}{27}\right )+\frac {x^3\,\ln \left (c\,x^n\right )\,\left (2\,a\,b-\frac {2\,b^2\,n}{3}\right )}{3}+\frac {b^2\,x^3\,{\ln \left (c\,x^n\right )}^2}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a + b*log(c*x^n))^2,x)

[Out]

x^3*(a^2/3 + (2*b^2*n^2)/27 - (2*a*b*n)/9) + (x^3*log(c*x^n)*(2*a*b - (2*b^2*n)/3))/3 + (b^2*x^3*log(c*x^n)^2)
/3

________________________________________________________________________________________

sympy [B]  time = 1.52, size = 143, normalized size = 2.75 \[ \frac {a^{2} x^{3}}{3} + \frac {2 a b n x^{3} \log {\relax (x )}}{3} - \frac {2 a b n x^{3}}{9} + \frac {2 a b x^{3} \log {\relax (c )}}{3} + \frac {b^{2} n^{2} x^{3} \log {\relax (x )}^{2}}{3} - \frac {2 b^{2} n^{2} x^{3} \log {\relax (x )}}{9} + \frac {2 b^{2} n^{2} x^{3}}{27} + \frac {2 b^{2} n x^{3} \log {\relax (c )} \log {\relax (x )}}{3} - \frac {2 b^{2} n x^{3} \log {\relax (c )}}{9} + \frac {b^{2} x^{3} \log {\relax (c )}^{2}}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(a+b*ln(c*x**n))**2,x)

[Out]

a**2*x**3/3 + 2*a*b*n*x**3*log(x)/3 - 2*a*b*n*x**3/9 + 2*a*b*x**3*log(c)/3 + b**2*n**2*x**3*log(x)**2/3 - 2*b*
*2*n**2*x**3*log(x)/9 + 2*b**2*n**2*x**3/27 + 2*b**2*n*x**3*log(c)*log(x)/3 - 2*b**2*n*x**3*log(c)/9 + b**2*x*
*3*log(c)**2/3

________________________________________________________________________________________